import axios from "@/api/request"



const nutritionProduct = {
    add: "/back/nutritionProduct/add",
    update: "/back/nutritionProduct/update",
    delete: "/back/nutritionProduct/delete",
    findById: "/back/nutritionProduct/findById",
    findAll: "/back/nutritionProduct/findAll",
    search: "/back/nutritionProduct/search",
}

const productRecord = {
    add: "/back/productRecord/add",
    update: "/back/productRecord/update",
    delete: "/back/productRecord/delete",
    findById: "/back/productRecord/findById",
    findAll: "/back/productRecord/findAll",
    search: "/back/productRecord/search",
    searchByNutritionProductId: "/back/productRecord/searchByNutritionProductId",
}

const api = {

    nutritionProduct_add(params) {
        return axios.post(nutritionProduct.add, params)
    },
    nutritionProduct_update(params) {
        return axios.post(nutritionProduct.update, params)
    },
    nutritionProduct_delete(params) {
        return axios.delete(nutritionProduct.delete, {params})
    },
    nutritionProduct_findById(params) {
        return axios.get(nutritionProduct.findById, {params})
    },
    nutritionProduct_findAll(params) {
        return axios.get(nutritionProduct.findAll, {params})
    },
    nutritionProduct_search(params) {
        return axios.get(nutritionProduct.search, {params})
    },

    productRecord_add(params) {
        return axios.post(productRecord.add, params)
    },
    productRecord_update(params) {
        return axios.post(productRecord.update, params)
    },
    productRecord_delete(params) {
        return axios.delete(productRecord.delete, {params})
    },
    productRecord_findById(params) {
        return axios.get(productRecord.findById, {params})
    },
    productRecord_findAll(params) {
        return axios.get(productRecord.findAll, {params})
    },
    productRecord_search(params) {
        return axios.get(productRecord.search, {params})
    },
    productRecord_searchByNutritionProductId(params) {
        return axios.get(productRecord.searchByNutritionProductId, {params})
    },

}
export default api
